/**
 * 
 */
package com.sesame.daoimpl;

import java.util.List;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.sesame.dao.UserGroupDAO;
import com.sesame.domain.UserGroup;

/**
 * @author shubeta
 *
 */
public class UserGroupDAOImpl extends SqlMapClientDaoSupport implements UserGroupDAO {

    public void addUserGroup(UserGroup usergroup) {
        getSqlMapClientTemplate().insert("addUserGroup", usergroup);
    }

    public void deleteUserGroupById(Integer id) {
        getSqlMapClientTemplate().delete("deleteUserGroupById", id);
    }
    
    @SuppressWarnings("unchecked")
    public List<UserGroup> getAllUserGroup() {
        return (List<UserGroup>) getSqlMapClientTemplate().queryForList("getAllUserGroup");
    }

    public UserGroup getUserGroupById(Integer id) {
        return (UserGroup) getSqlMapClientTemplate().queryForObject("getUserGroupById", id);
    }

    public void updateUserGroup(UserGroup group) {
        getSqlMapClientTemplate().update("updateUserGroup", group);
    }

}
